home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7422 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Does Borland C++ 5.0 still work with normal C???
  5. Date: 25 Feb 1996 19:56:37 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb25125637@qcd.lanl.gov>
  8. References: <n4mwd.33.000A228B@magg.net> <4gdkv3$q8a@druid.borland.com>
  9.     <4ggsie$1fg@dopey.magg.net> <4gqdf7$jfo@redstone.interpath.net>
  10. NNTP-Posting-Host: qcd.lanl.gov
  11. Mime-Version: 1.0
  12. Content-Type: text
  13. In-reply-to: softbase@mercury.interpath.net's message of 25 Feb 1996 19:31:51 GMT
  14.  
  15. In article <4gqdf7$jfo@redstone.interpath.net>
  16. softbase@mercury.interpath.net (Scott McMahan - Softbase Systems) writes:
  17.  
  18. SMSS: Dennis Hawkins (n4mwd@magg.net) wrote:
  19. SMSS: 
  20. SMSS: : printf("%ld\n", (long) sizeof 'a');
  21. SMSS: 
  22. SMSS: : and produce an EXE that generates '2' for the output.
  23. SMSS: 
  24. SMSS: How do you get two out of this? A char is 1, and casting that to a long
  25. SMSS: is still 1, only it takes up more bytes. How can this evaluate to 2?
  26. SMSS: sizeof char being 1 is kinda hard-wired into the language.
  27.  
  28. Except, in C, 'a' is not a char, but an int.
  29.  
  30. Cheers
  31. Tanmoy
  32. --
  33. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  34. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  35. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  36. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  37. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  38. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  39.